﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Reflection;
using System.Text;
using THE_LAST.Helper;
using Xamarin.Forms;
using XiaoMi8.MarkupExtension;
using XiaoMi8.Models;

namespace XiaoMi8.ViewModels
{
    class ListViewViewModel : BaseViewModel
    {
        private ObservableCollection<ListViewModel> listViewModels;

        public ListViewViewModel()
        {
            listViewModels = new ObservableCollection<ListViewModel>();


            for (int i = 0; i < 10; i++)
            {
                listViewModels.Add(new ListViewModel { Title = "这是第"+i.ToString()+"条文章,只是测试一下", Image = ImageSource.FromResource("XiaoMi8.Images.img_profile.png", typeof(EmbeddedImageExtension).GetTypeInfo().Assembly)
            });
            }
        }

        public ObservableCollection<ListViewModel> ListViewModels
        {
            get { return listViewModels; }
            set { listViewModels = value;RaisePropertyChanged("ListViewModels"); }
        }
    }
}
